#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <string>
using namespace std;

const int MAXV = 100010;
const int MAXE = 100010 * 2;

int first[MAXV], next[MAXE], end[MAXE], cost[MAXE];
int d[MAXV], up[MAXV], was[MAXV];
int Time, edges, n, m;


void addEdge(int i, int j)
{
	next[edges] = first[i];
	first[i] = edges;
	end[edges] = j;
	edges++;
}

void Load()
{
	cin >> n >> m;
	int i;
	int a, b;
	memset(first, -1, sizeof first);
	edges = 0;
	for (i = 0; i < m; i++)
	{
		scanf("%d%d", &a, &b);
		addEdge(a, b);
		addEdge(b, a);
	}
}

int begin_ver;
vector <int> result, bridges; 

void go(int ver, int last)
{
	Time++;
	was[ver] = Time;
	up[ver] = Time;
	int a = 0;
	for (int u = first[ver]; u != -1; u = next[u])
	{
		if (was[end[u]] == 0)
		{
			a++;
			go(end[u]);
			if (up[end[u]] >= was[end[u]])
				bridges.push_back(u);
			up[ver] = min(up[ver], up[end[u]]);
		}
		else if (last != (u ^ 1)) 
			up[ver] = min(up[ver], was[end[u]]);
	}
}

void dfs(int ver)
{
	was[ver] = 1;
	int u;
	for (u = first[ver]; u != -1; u = next[u])
	{
		if (was[end[u]] == 0)
		{
			up[end[u]] = 
			dfs(end[u]);
		}
	}
}

void Solve()
{
	int i;
	for (i = 1; i <= n; i++)
	{
		if (was[i]) continue;
		begin_ver = i;
		go(i);
	}
	sort(result.begin(), result.end());
	result.erase(unique(result.begin(),result.end()), result.end());
	cout << result.size() << "\n";
	for (i = 0; i < result.size(); i++)
	{
		printf("%d\n", result[i]);
	}
}

#define file "regions"

int main()
{
	freopen(file".in", "rt", stdin);
	freopen(file".out", "wt", stdout);
	Load();
	Solve();
	return 0;
}